home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Scope / Scope Disk #017 (199x)(Scope PD)(US)[WB].zip / Scope Disk #017 (199x)(Scope PD)(US)[WB].adf / BShell / bsh.doc < prev    next >
Text File  |  1988-07-13  |  9KB  |  234 lines

  1.  
  2.  
  3.                                 bsh preliminary docs
  4.  
  5.           NAME
  6.                bsh  -  A simple shell with last command recall
  7.  
  8.           PURPOSE
  9.                     After finally getting a chance to read through the
  10.                functions in arp.library I wanted to write a program to
  11.                try them  out.  One of the things that I have wanted on
  12.                the Amiga was the ability to go back and edit a command
  13.                previously  typed.    I  also wanted the ability to use
  14.                pipes (|) between concurrent processes easily as in the
  15.                Unix  shells.     This  is  not  currently  implemented
  16.                unfortunately as I want to see what the  pipe device is
  17.                like that  comes with  1.3 before  adding that feature.
  18.                This shell relies on the arp.library (V34) and  the Arp
  19.                commands to provide much of its functionality.  It does
  20.                not have many built in commands  as it  is assumed that
  21.                you will  either use  REZ or  the Arp Resident command.
  22.                See the section RESIDENT  below  for  more information.
  23.                As I  have seen some interest in using the Arp Resident
  24.                command,  and some others may  also be  interested in a
  25.                simple   shell   with   last   command   recall,  I  am
  26.                distributing the shell, though as  a  use  at  your own
  27.                risk  program  (ie.  it  has  not  yet been extensively
  28.                tested).
  29.  
  30.           BUILT IN COMMANDS
  31.                The following functions are built into the shell:
  32.  
  33.                bind  --   bind str1 str2
  34.                        The bind function causes  the first string
  35.                     to be mapped to the second.  The binding is a
  36.                     low level function done before any parsing of
  37.                     the  input   is  done.     It   is  not  done
  38.                     recursively so no danger exists of infinitely
  39.                     long expansions.  The most common use of this
  40.                     function  is  to  map  the  function  keys to
  41.                     useful strings.   Another  use is  to map the
  42.                     control keys and the  arrow keys  to internal
  43.                     shell  functions...  this  is  currently done
  44.                     automatically by the shell.  A future version
  45.                     will use  a startup script, which will do the
  46.                     bindings, allowing for  customization  of the
  47.                     key sequences  used.   It also  allows you to
  48.                     "bind x y"  which  will  make  all  x's typed
  49.                     become y's,   but  be careful  as there is no
  50.                     way to unbind a string.  The first string may
  51.                     not contain spaces,  though the second string
  52.                     can.
  53.  
  54.                     Example of use:
  55.  
  56.                                  June 24, 1988                       Page 1
  57.  
  58.  
  59.  
  60.  
  61.  
  62.                                 bsh preliminary docs
  63.  
  64.                         bind *x9b4~ list bsh*x0d
  65.  
  66.                     The above command will  bind the  F5 function
  67.                     key  to  generate  the string "list bsh" when
  68.                     typed. The *x0d at the end causes it  to also
  69.                     act as  if the  return key  has been pressed.
  70.                     The above assumes that  you  have  left Arp's
  71.                     settings to  use BCPL  escape sequences.  See
  72.                     Arp's set command and  the EscapeString() man
  73.                     page for more information.
  74.  
  75.                clear -- clear
  76.                     The clear  command clears the window that the
  77.                     shell in  which  you  issued  the  command is
  78.                     running in.  Currently bound to ^L also.
  79.  
  80.                exit -- exit
  81.                          This is  the command  to get  out of bsh
  82.                     and return to the  normal  CLI  that  bsh was
  83.                     invoked from.  Currently bound to ^D also.
  84.  
  85.                ver  --  ver
  86.                          This  command  prints  out  the  version
  87.                     number of bsh that  you  are  running.   This
  88.                     number should  be given in any bug report etc
  89.                     on bsh.
  90.  
  91.           COMMAND LINE EDITING
  92.                The last twenty commands typed  are  saved  and  can be
  93.                recalled,  edited   and  resubmitted.    The  functions
  94.                available for  editing  the  commands  and  the default
  95.                bindings are described below.
  96.  
  97.                MOVE RIGHT
  98.                     Moves  the  cursor  nondestructively  to  the
  99.                     right.  This function  is bound  to the right
  100.                     arrow key.
  101.                MOVE LEFT
  102.                     Moves  the  cursor  nondestructively  to  the
  103.                     left.  This function  is  bound  to  the left
  104.                     arrow key.
  105.                NEXT COMMAND
  106.                     If you  pass the  command you want,  the next
  107.                     command  function  moves  back   through  the
  108.                     command history.   This  function is bound to
  109.                     the down arrow key.
  110.                PREVIOUS COMMAND
  111.                     Recalls the command that was typed before the
  112.                     command being  shown on  the command line, up
  113.                     to  the  history  limit  (currently  the last
  114.  
  115.                                  June 24, 1988                       Page 2
  116.  
  117.  
  118.  
  119.  
  120.  
  121.                                 bsh preliminary docs
  122.  
  123.                     twenty commands).   This function is bound to
  124.                     the up arrow key.
  125.                REDRAW LINE
  126.                     Reprints the  current command.   Useful after
  127.                     you have  resized the  window.  This function
  128.                     is bound to the key ^R.
  129.                DELETE CHAR
  130.                     Delete  the  character  currently  under  the
  131.                     cursor.  This function is bound to the delete
  132.                     key.
  133.                DELETE CHAR LEFT
  134.                     Delete  the  character  to  the  left  of the
  135.                     cursor.    This  function  is  bound  to  the
  136.                     backspace key.
  137.                DISPLAY HISTORY
  138.                     Shows  the  commands  stored  in  the history
  139.                     buffer.  This function is bound to the escape
  140.                     key.
  141.                 
  142.           RESIDENT
  143.                The use of  either  the  Arp  resident  program  or the
  144.                program REZ  is extremely  recommended.  Please see the
  145.                documentation  that  comes  with   these  programs  for
  146.                information on  there use.   Arp's  Resident program is
  147.                more limited in some ways  then  REZ.    Arp's resident
  148.                sets up  a list  of the  resident programs that must be
  149.                searched before looking to the disk  for a  program and
  150.                requires  the  program  to  meet tougher qualifications
  151.                then REZ.  REZ patches the LoadSeg() function  and thus
  152.                works with the standard CLI also.  REZ also allows more
  153.                programs to be made resident then Arp's Resident.   REZ
  154.                seems  to  require  more  overhead  then Arp's Resident
  155.                though.  If all you are going to make Resident is Arp's
  156.                own  commands   then  you  should  probably  use  Arp's
  157.                Resident...    otherwise  if  you  want  to  access the
  158.                commands  from  the  standard  CLI also, or you want to
  159.                make other programs resident  besides Arp's  you should
  160.                use REZ.
  161.  
  162.           KNOWN LIMITATIONS
  163.                     As bsh  uses arp.library  functions to execute all
  164.                external commands (this is  what  allows  the  shell to
  165.                utilize  Arp's  Resident  program  feature) it will not
  166.                pass arguments to BCPL  programs.   In addition  I have
  167.                found that  programs compiled  under Manx 3.2a will not
  168.                be passed arguments also.    This  means  that  the run
  169.                command  can  not  be  used....  use  the  arun command
  170.                supplied with Arp instead.  To make this  easier the F1
  171.                key is bound to the string "arun ".
  172.  
  173.  
  174.                                  June 24, 1988                       Page 3
  175.  
  176.  
  177.  
  178.  
  179.  
  180.                                 bsh preliminary docs
  181.  
  182.                     Some  programs  crash  when  invoked from bsh when
  183.                they  are  exited...  one   that   I   have   found  is
  184.                WordPerfect.   I am  not sure  if this  is a bug in the
  185.                SyncRun() function, the shell,  or those  programs that
  186.                crash on exit.
  187.  
  188.                     As  a  result  of  the  way bsh parses the command
  189.                line,  no spaces are allowed  in the  command argument.
  190.                In other  words the name of the program to execute must
  191.                not have any spaces in it.
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.                                  June 24, 1988                       Page 4
  234.